package com.home.qh.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.home.qh.dao.CommodityDao;
import com.home.qh.model.Commodity;
import com.home.qh.service.CommodityManager;

@Service("commodityManager")
public class CommodityManagerImpl extends GenericManagerImpl<Commodity, Long> implements	CommodityManager {
	CommodityDao commodityDao;

    @Autowired
    public CommodityManagerImpl(CommodityDao commodityDao) {
        super(commodityDao);
        this.commodityDao = commodityDao;
    }

	public List<Commodity> getCommodityByCodeAndName(String commodityCode,
			String commodityName) {
		return commodityDao.getCommodityByCodeAndName(commodityCode, commodityName);
	}

	public List<Commodity> getCommodityByCommodity(Commodity commodity, String sort, boolean desc, int startResult, int maxResults) {
		return commodityDao.getCommodityByCommodity(commodity, sort, desc, startResult, maxResults);
	}
}
